
import uservice from './request'
import qs from './qs'


const http={
	get(url,params){
	    const config={
	        method :'get',
	        url:url,
	    }
	    if(params) config.data = params
		return uservice(config)
    },
	post(url,params,serialize){
	    const config={
	        method :'post',
	        url:url,
	    }
	    if(params) {
            if (serialize === false){
                config.data = params
            }else {
                config.data = qs.stringify(params)
                config.headers = {'Content-Type':'application/x-www-form-urlencoded'}
            }
        }
		return uservice(config)
    },
    
}
//导出
export default http